package com.xyp.a_demo;

/**
 * --- 加油，努力 ---
 *
 * @Author XYP
 * @Date 2024/8/5
 * @Desc 从想做到能做
 */
class Mythread extends Thread {
    public Mythread() {
    }

    public Mythread(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println("Hello");
        }
    }
}
public class Demo1 {
    public static void main(String[] args) {
        Thread t1 = new Mythread("狗蛋");
        System.out.println(t1.getName());
        t1.start();
        System.out.println("hello!");
    }
}
